package com.example.jpa.crud.annotation;

import com.example.jpa.crud.model.DefaultReplaceStrategy;
import com.example.jpa.crud.model.DisplayStrategy;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import java.util.function.Function;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

@Retention(RUNTIME)
@Target(value = {FIELD})
@Documented
public @interface CrudField {

    DisplayStrategy display() default DisplayStrategy.DEFAULT;

    Class<? extends Function<?, ?>> replace() default DefaultReplaceStrategy.class;

    Class<?> ref() default Object.class;

    String refColumnName() default "id";

    int depth() default 1;

}